package com.example.rpAdapter.web.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.common.annotation.ResponseResult;
import com.example.rpclient.api.IUserService;
import com.example.rpclient.dto.data.UserVo;
import com.example.rpclient.dto.query.UserListByParamQuery;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Slf4j
@AllArgsConstructor
@ResponseResult
@RequestMapping("/admin/v1/user")
public class AdminUserController {

    private final IUserService userService;


    @PostMapping("/one")
    public UserVo one(@RequestParam(value = "id") Long id){
        return userService.one(id);
    }

    @PostMapping("/page")
    public IPage<UserVo> page(@RequestBody UserListByParamQuery query){
        return userService.page(query);
    }
}
